<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{literal}</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="language.builtin.functions.html" title="Chapter 7. Built-in Functions">
<link rel="prev" href="language.function.ldelim.html" title="{ldelim},{rdelim}">
<link rel="next" href="language.function.nocache.html" title="{nocache}">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">{literal}</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.function.ldelim.html">Prev</a> </td>
<th width="60%" align="center">Chapter 7. Built-in Functions</th>
<td width="20%" align="right"> <a accesskey="n" href="language.function.nocache.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="{literal}">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.function.literal"></a>{literal}</h2></div></div></div>
<p>
  <code class="varname">{literal}</code> tags allow a block of data to be taken literally. This is typically
  used around Javascript or stylesheet blocks where {curly braces} would
  interfere with the template <a class="link" href="variable.left.delimiter.html" title="$left_delimiter">delimiter</a> syntax. Anything within
  <code class="varname">{literal}{/literal}</code> tags is not interpreted, but displayed as-is.
  If you  need template tags embedded in a <code class="varname">{literal}</code> block, consider using
  <a class="link" href="language.function.ldelim.html" title="{ldelim},{rdelim}"><code class="varname">{ldelim}{rdelim}</code></a> to escape the
  individual delimiters instead.
 </p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
   <code class="varname">{literal}{/literal}</code> tags are normally not necessary, as Smarty ignores delimiters that are surrounded by whitespace.
   Be sure your javascript and CSS curly braces are surrounded by whitespace. This is new behavior to Smarty 3.
 </p>
</div>
<div class="example">
<a name="id377465"></a><p class="title"><b>Example 7.59. {literal} tags</b></p>
<div class="example-contents"><pre class="programlisting">

&lt;script&gt;
   // the following braces are ignored by Smarty
   // since they are surrounded by whitespace
   function myFoo {
     alert('Foo!');
   }
   // this one will need literal escapement
   {literal}
     function myBar {alert('Bar!');}
   {/literal}
&lt;/script&gt;

  </pre></div>
</div>
<br class="example-break"><p>
  See also
  <a class="link" href="language.function.ldelim.html" title="{ldelim},{rdelim}"><code class="varname">{ldelim} {rdelim}</code></a>
  and the
  <a class="link" href="language.escaping.html" title="Escaping Smarty Parsing">escaping Smarty parsing</a> page.
 </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.function.ldelim.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.builtin.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.function.nocache.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">{ldelim},{rdelim} </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> {nocache}</td>
</tr>
</table>
</div>
</body>
</html>
